package constant

import "github.com/pkg/errors"

const PUBLIC_USER = "PUBLIC"
const PRIVATE_USER = "PRIVATE"

const PRIVATE_DEVICE_LIMIT = 10
const PRIVATE_USER_LOGIN_URL = "https://espush.cn/api/portal/login"

const MSG_DIRECTION_UP int = 0
const MSG_DIRECTION_DOWN int = 1

const GAVATAR_PROXY_URL string = "/gavatar/"

// 配置为 55 秒，客户端从60 开始数，中间留5秒空隙；
const SMS_RESEND_SECOND_TIME = 55
const SMS_EXPIRE_SECOND_TIME = 60 * 5

const DEV_PROTOCOL_MAX_FRAME uint32 = 1500
const DEV_PROTOCOL_UNAUTH_TIMEOUT int = 10
const DEV_PROTOCOL_TIMEOUT1 int = 10
const DEV_PROTOCOL_HEARTBEAT int = 190
const DEV_PUSH_WAIT_TIMEOUT int64 = 20
const EXTRA_INFO_KEY = "EXTRA_INFO"
const LASTEST_IPADDR = "LASTEST_IPADDR"
const LASTEST_SESSION_TOKEN = "LASTEST_SESSION_TOKEN"
const MESSAGE_TOKEN = "MESSAGE_TOKEN"
const NBDEVICE_PROTOCOL = "NBDEVICE_PROTOCOL"

const JWT_API_KEY_APP string = "JWT_API_KEY_APP"

const (
	NOTIFY_TOPIC_ONLINE      = "DEV.ONLINE"
	NotifyUserRegistered     = "User.Registered"
	NotifyDeviceOffline      = "Device.Offline"
	NOTIFY_TOPIC_UP_MSG      = "DEV.UP.MSG"
	NOTIFY_TOPIC_ACK_MSG     = "DEV.ACK.MSG"
	NotifyFileUploadFinished = "File.Upload.Finished"
)

const NBIOT_PROTOCOL_TUP = "TUP"
const NBIOT_PROTOCOL_LWM2M = "LWM2M"
const NBIOT_PROTOCOL_ONENET_LWM2M = "LWM2M/ONENET"
const NBIOT_PROTOCOL_UNKNOWN = "UNKNOWN"

const END_USER_TYPE = "End-User"
const DEVELOPER_USER_TYPE = "Developer"

const EXCLUDE_GZIP_KEY = "EXCLUDE_GZIP"

// 查询周期属性名
const ATTR_QUERY_INTERVAL = "MODBUS_LIGHT_QUERY_INTERVAL"
const DEFAULT_QUERY_INTERVAL = 60

const BAIDU_MAPS_AK = "Bzw4SC2SwTDAGV4Kkz29emp5jb6M1URb"

const LogFields = "GinLogFields"

//const NotifyInprocName = "inproc://run.espush.sock"
const NotifyInprocName = "tcp://127.0.0.1:5555"

var TimeoutError = errors.New("Timeout")
var OfflineError = errors.New("Offline")
var NotFoundError = errors.New("NotFound")
var NotImplError = errors.New("NotImplemented")

const MiddleRequestObject string = "MiddleRequestObject"

const (
	DeviceProtocolHandlerWiFi = "WIFI"
	WiFiDeviceFakeModbusAddr  = 1
)
